<div class="box box-primary">
    <div class="box-header">
        <i class="ion ion-clipboard"></i>
        <h3 class="box-title">
            {{lotes['0'].TITLE}}
            <br /> <small><i class="fa fa-clock-o"></i> ENCERRADO :
                {{lotes['0'].DATA| dateFromDB:'dd/MM/yyyy H:i' }} </small>
        </h3>
        <div class="box-tools">
            <ul
                class="pagination pagination-sm pagination-info no-margin pull-right">
                <li><a href="#/leilao/settings/{{lotes['0'].ID}}"><i
                            class="fa fa-undo"></i>&nbsp;&nbsp;Ir para Leilões</a></li>
                <li><a href="#/accountability"><i
                            class="fa fa-undo"></i>&nbsp;&nbsp;Ir para Prestação de Contas</a></li>
            </ul>
        </div>

    </div>
    <!-- /.box-header -->
    <div class="box-body">

        <table class="table table-bordered">
            <tbody>
                <tr>
                    <th style="width: 50px">#</th>
                    <th class="col-xs-4 col-md-3 col-lg-2">DATA HORA</th>
                    <th>DESCRIÇÃO</th>
                    <th>LANCE INICIAL</th>
                    <th>VMV</th>
                    <th>GANHADOR</th>
                    <th>LANCE</th>
                    <th>VISITAS</th>
                    <th class="col-xs-3 col-md-2 col-lg-1">LOCALIZAÇÃO</th>
                    <th>PAG.</th>
                    <th>REV.</th>
                    <th>VENDA</th>
                </tr>

                <tr ng-repeat="lote in lotes">
                    <td>{{lote.NUM_LOTE}} <strong>({{lote.IDD}})</strong></td>
                    <td>{{lote.FECHAMENTO| dateFromDB:'dd/MM/yyyy H:i'}}</td>
                    <td>{{lote.LOTE_DESCRICAO}}</td>
                    <td>R$ {{lote.LANCE_INICIAL| numberFormat:[2,',','.']}}</td>
                    <td>R$ {{lote.VALOR_MINIMO| numberFormat:[2,',','.']}}</td>
                    <td class="ibg-default">{{ lote.LOGIN}}</td>
                    <td class="ibg-default">R$ {{lote.LANCE_GANHADOR|
						numberFormat:[2,',','.'] }} <span
                            options-tool-tip='{"html":true,"placement":"bottom","container":"body"}'
                            coc-tool-tip
                            class="icon-preview-condicional fa text-red fa-exclamation-triangle pull-right"
                            ng-if="isCondicional(lote)" title="Lote Condicional"></span>
                    </td>
                    <td>{{lote.VISITAS|| 0}}</td>
                    <td>{{lote.CIDADE}}/{{lote.UF_LOTE}}</td>
                    <td class="ibg-default">
                        <i href="" class="text-red fa fa-times" ng-if="lote.PAGAMENTO_ID == 0 && lote.VENDIDO == 'S'" coc-tool-tip title="Pagamneto não realizado"></i>
                        <i ng-if="lote.PAGAMENTO_ID > 0" class="text-green fa fa-check" coc-tool-tip title="<?php echo lang_system('admin_payment_user_confirmed'); ?>"></i>
                        <a  ng-if="lote.PROPOSTA_ID > 0 && lote.LANCE_GANHADOR == null && lote.APROUVE == 3"  options-tool-tip='{"html":true,"placement":"bottom","container":"body"}'
                            title="<?php echo lang_system('admin_title_exists_proposta'); ?>"         
                            ng-click="userProposta(lote)" coc-tool-tip class="text-red_2" coc-click-prevent href="#"><i class="fa fa-share-square"></i></a>
                    </td>
                    <td class="ibg-default">
                        <i ng-if="lote.CONFIRMADO == 'S'" class="text-green fa fa-check" coc-tool-tip title="Pagamento confirmado"></i>
                        <a href="#" ng-if="lote.CONFIRMADO == 'N'"> <i
                                class="text-red fa fa-question"
                                coc-click-prevent  ng-click="confirmPayment(lote)"
                                coc-tool-tip title="<?php echo lang_system('admin_not_payment_confirmed'); ?>"></i></a>
                        <span ng-if="lote.PAGAMENTO_ENVIADO == 'S'" class="separator"> | </span>
                        <a class="text-back-text" coc-tool-tip ng-if="lote.PAGAMENTO_ENVIADO == 'S'" title="<?php echo lang_system('admin_show_comprovante'); ?>" coc-click-prevent  ng-click="showComprovante(lote.COMPROVANTE)" href="#"><i class="fa fa-file-archive-o"></i></a>
                    </td>
                    <th>
            <div class="btn-group">

                <i ng-if="lote.VENDIDO == 'S'" class="text-green fa fa-check"
                   coc-tool-tip title="Lote vendido"></i> <i
                   ng-if="isVendido(lote)" class="text-red fa fa-times"
                   coc-tool-tip title="Lote não vendido"></i> <a href="#"
                   coc-click-prevent
                   ng-if="lote.CONDICIONAL == 'S' && lote.FECHADO == 'N' && lote.APROUVE === null"
                   ng-click="aprouveLote(lote)" coc-tool-tip
                   title="Lote Condicional aprovar ou reprovar " class="text-red">Pendente</a>

                <span coc-tool-tip title="<?php echo lang_system('admin_title_lote_with'); ?>" ng-if="lote.CONDICIONAL == 'S' && lote.APROUVE == 0"><i class="fa fa-exclamation-triangle"></i></span>
                <span coc-tool-tip title="<?php echo lang_system('admin_title_nfe_enabled'); ?>" class="enabled-nfe" ng-if="lote.NFE_LIBERADO == 'S'"><i class="fa fa-file-pdf-o"></i></span>
                <a class="text-back-text" ng-if="lote.CONFIRMADO == 'S' && (lote.NFE_LIBERADO == 'N' || lote.NFE_LIBERADO == null)" coc-click-prevent  ng-click="enableNFE(lote.NFE_ID)" href="#"><i class="fa fa-file-pdf-o"></i></a>
            </div>
            </th>

            </tr>

            </tbody>
            <tfoot>
                <tr class="ibg-default">
                    <td><!-- ID --></td>
                    <td><!-- NUM LOTE --></td>
                    <td><!-- HORA --></td>
                    <td>R$ {{totais.LANCE_INICIAL| numberFormat:[2,',','.']}}</td>
                    <td>R$ {{totais.VALOR_MINIMO| numberFormat:[2,',','.']}}</td>
                    <td></td>
                    <td>R$ {{totais.LANCE_GANHADOR| numberFormat:[2,',','.']}}</td>
                    <td>{{totais.VISITAS}}</td>
                    <td></td>
                    <td></td>
                    <td><!-- HORA --></td>
                    <td><!-- HORA --></td>
                </tr>
            </tfoot>






        </table>



    </div>
    <div class="box-footer clearfix no-border">
        <a coc-tool-tip title="Gerar baixa" ng-if="lotes['0'].PRESTACAO_CONTAS == 'N' && lotes['0'].STATUS == 4"
           href="#" coc-click-prevent  
           ng-click="onCloseLeilao()"
           class="btn btn-sm btn-primary"><i class="fa fa-download"></i>&nbsp;
            Gerar Baixa</a>

        &nbsp; <a coc-tool-tip title="Gerar um relatório detalhado do leilão em pdf" href="<?php echo base_url('reports-admin-leilao-statistics-') ?>{{lotes['0'].ID}}-pdf.html"class="btn btn-sm btn-primary"><i class="fa fa-file-pdf-o"></i>&nbsp; Gerar PDF</a>
        &nbsp;<a coc-tool-tip title="Gerar um relatório detalhado do leilão em excel" href="<?php echo base_url('reports-admin-leilao-statistics-') ?>{{lotes['0'].ID}}-xls.html" class="btn btn-sm btn-success"><i class="fa fa-file-excel-o"></i>&nbsp; Gerar Excel</a>	
    </div>

</div>